package psn.qiuyiping.autocad.dxffile;

@Dxf0Name("LTYPE")
@SubClassName("AcDbLinetypeTableRecord")
public class DxfLType extends DxfTableRecord {
    @DxfCode(3)
    String                       desc;
    @DxfCode(73)
    int                          count;
    @DxfCode(40)
    double                       totalLength;
    java.util.List<LTypeSection> segs;

    @DxfCode(49)
    public void readSegment(DxfProcessContext context, DxfData item) {
        if (segs == null) {
            segs = new java.util.ArrayList<>();
        }
        LTypeSection seg = new LTypeSection();
        segs.add(seg);
        seg.length = (Double) item.getVal();
        context.push(seg);
    }

    public class LTypeSection extends DefaultDxf0 {
        double    length;
        @DxfCode(74)
        int       flag;
        @DxfCode(75)
        int       shape;
        @DxfCode(340)
        DxfHandle style;
        @DxfCode(46)
        double    scale;
        @DxfCode(44)
        double    xoff;
        @DxfCode(45)
        double    yoff;
        @DxfCode(50)
        double    rotation;
        @DxfCode(9)
        String    text;
        
        @DxfCode(49)
        public void readSegment(DxfProcessContext context, DxfData item) {
            context.pop();
            context.process(item);
        }
    }
}
